<?php
/**
 * 自定义post_type 分类页面模板
 */
get_header();
?>
<main class="main_content">
    <link rel="stylesheet" href="<?php echo get_theme_file_uri('assets/css/lightbox.css')?>">
    <?php get_template_part('parts/content/page','banner');?>

    <section class="page-content container py-5">
        <div class="row content-main pb-5 work-gallery">
            <?php
            $term = get_term(get_queried_object_id() , 'genre');
            $args = [
                'post_type' => 'portfolio',
                'tax_query' => [
                    'taxonomy' => 'genre',
                    'field'    => 'slug',
                    'terms'    => $term->slug
                ]
            ];
            $query = new WC_Query($args);
            if (have_posts()) :
                while(have_posts()) : the_post();
                    ?>
                    <div class="col-md-3 mb-4 px-0 mx-2">
                        <?php
                        get_template_part('parts/post/work','portfolio');
                        ?>
                    </div>
                <?php
                endwhile;
            endif;
            ?>
        </div>
    </section>

</main>
<?php get_footer();
?>
<script src="<?php echo get_theme_file_uri('assets/js/imagelightbox.js')?>"></script>
<script src="<?php echo get_theme_file_uri('assets/js/imagebox.js')?>"></script>

